package com.zsl.swing.redis.desktop.type;

public enum BooleanEnum {

    TRUE(1,"是"),FALSE(0,"否");

    private final int code;

    private final String text;

    BooleanEnum(int code, String text){
        this.code = code;
        this.text = text;
    }

    public static boolean isTrue(Integer formattedDisplay) {
        return formattedDisplay != null && TRUE.code == formattedDisplay;
    }

    public static boolean isTrueText(String selectedItem) {
        return TRUE.getText().equals(selectedItem);
    }

    public int getCode(){
        return this.code;
    }

    public String getText(){
        return this.text;
    }
}
